<?php

namespace app\adminapi\export;

use app\services\order\OrderService;
use app\services\user\UserExtractServices;

class FinanceExtraExport extends BaseExport
{
    protected $header = [
        '申请时间', '类型', '提现单号', '申请人', '申请人手机号', '账号余额(元)', '提现金额(元)', '银行账号', '状态'
    ];

    public function createData(array $where)
    {
        $list = app()->make(UserExtractServices::class)->index($where)['list'];

        $data = [];

        foreach ($list as $item) {
            $data[] = [
                $item['trade_time'] ?? '',
                $item['order_type_text'] ?? '',
                $item['distributor_name'] ?? '',
                $item['sn'] ?? '',
                $item['price'] ?? '',
                $item['pay_price'] ?? '',
                $item['commission'] ?? '',
                $item['distributor_price'] ?? ''
            ];
        }
        return $data;
    }
}